package com.wyt.controller.instorageController;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.wyt.dao.InstOrAgeMapper;
/*import com.wyt.dao.InstOrAgeMapper2;*/
import com.wyt.entity.Book;
import com.wyt.until.TableLayui;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @program: xiangmu01
 * @description: 入库表功能
 * @author: 冯波涛
 * @create: 2021-11-23 16:20
 **/

@RestController
@RequestMapping("/inStorage")
public class DangerInstorageController {
    @Autowired
    public InstOrAgeMapper instOrAgeMapper;

    /**
     * 查询所有书籍信息 + 书籍类型
     * @param
     * @return
     */
    @RequestMapping("/selectAllBook")
    public TableLayui selectAllBook(Integer limit,Integer page) {
        PageHelper.startPage(page,limit);
        List<Book> books = instOrAgeMapper.selectAllBook();
        PageInfo<Book> pageInfo=new PageInfo<>(books);
        return new TableLayui(0,"", pageInfo.getTotal(),pageInfo.getList());
    }
}
